package com.hcbd.tdwt.base.bd;
import android.app.Activity;

import com.hcbd.tdwt.MainApp;
import com.hcbd.tdwt.base.BeidouBoxParams;
import com.hcbd.tdwt.base.Constant;

public class XyPdaBdSendChild extends BdSendBase {
    private XYSerialPortManage serialPort;
    private RnssSerialPortManage rnssSerialPort;
    public XyPdaBdSendChild(){
        serialPort=XYSerialPortManage.getInstance();
        rnssSerialPort=RnssSerialPortManage.getInstance();
    }
    @Override
    public void close(Activity activity) {
        if(BeidouBoxParams.isBoxConnectNormal){
            serialPort.closeXYSerialPort();
        }
    }

    @Override
    public void open(Activity activity, int code) {
        serialPort.openXYSerialPort();
    }

    public void openRN(){
        rnssSerialPort.openXYSerialPort();
    }
    public void closeRN(){
        rnssSerialPort.closeXYSerialPort();
    }

    @Override
    public void sendMsg(String number, int frePoint, int mode, String content) {
        if(BeidouBoxParams.card_model==2){
            frePoint=1;
        }
        serialPort.onPackageThroughCCTCQ(mode,frePoint,number,content);
    }
    @Override
    public void getICInfo() {

    }
    @Override
    public void sendEPQInfo(String TheReceivingPartyID,int EmergencySigns, int ElevationValue, int SearchAndRescueType) {
        serialPort.onSendCCEPQ(TheReceivingPartyID, EmergencySigns,ElevationValue,SearchAndRescueType);
    }

}
